<%@include file="_header.jspf" %>
<%@page import="com.spartancoder.accommodation.models.Student" %>
<%@page import="com.spartancoder.accommodation.beans.StudentBean" %>

<h2>Listare studenti</h2>

<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>Nume</th>
            <th>Cnp</th>
            <th>Email</th>
            <th>Activ</th>
            <th>Optiuni</th>
        </tr>
    </thead>
    <tbody>
    <% for( StudentBean sb : Student.fetchAll() ) { %>
        <tr>
            <td><%=sb.getStudentId()%></td>
            <td>
                <a href="list-options.jsp?id=<%=sb.getStudentId()%>">
                    <%=sb.getLastName()%> <%=sb.getFirstName()%>
                </a></td>
            <td><%=sb.getCnp()%></td>
            <td><%=sb.getEmail()%></td>
            <td><%=sb.isActive()%></td>
            <td>
                <a href="remove-student.jsp?id=<%=sb.getStudentId()%>">sterge</a>
            </td>
        </tr>
    <% } %>
    </tbody>
</table>

<%@include file="_footer.jspf" %>